﻿
@{
    ViewData["Title"] = "智慧档案馆-登录页";
    Layout = "_LoginLayout";
}


<input type="hidden" id="TenantId" name="TenantId" value="" />
<div class="header"></div>
<div class="loginWraper">
    <div id="loginform" class="loginBox">
        <form class="form form-horizontal" name="login-form">
            <div class="row cl">
                <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60d;</i></label>
                <div class="formControls col-xs-8">
                    <input id="" name="username" type="text" placeholder="账户" class="input-text size-L">
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60e;</i></label>
                <div class="formControls col-xs-8">
                    <input id="" name="pwd" type="password" placeholder="密码" class="input-text size-L">
                </div>
            </div>

        </form>
        <div class="row cl">
            <div class="formControls col-xs-8 col-xs-offset-3">
                <button name="" onclick="login()" type="button" class="btn btn-success radius size-L" value="">&nbsp;登&nbsp;&nbsp;&nbsp;&nbsp;录&nbsp;</button>
                <button onclick="reset()" name="" type="button" class="btn btn-default radius size-L" value="">&nbsp;取&nbsp;&nbsp;&nbsp;&nbsp;消&nbsp;</button>
            </div>
        </div>
    </div>
</div>
<script>
    function reset() {
        $('form')[0].reset();
    }

    function login() {
        var form = $('form').serialize();
        $.ajax({
            type: "POST",
            url: "/login/login",
            dataType: "json",
            data: form,
            success: function (msg) {
                if (msg.succeed) {
                    layer.msg('登录成功!', { icon: 1, time: 1500 }, function () {
                        window.location.replace("/index/index");
                    });
                } else {
                    layer.msg('登录失败!', { icon: 1, time: 1500 });
                };
            },
            error: function (msg) {
                layer.msg('操作失败!', { icon: 1, time: 1500 });
            }
        });
    }
</script>

